# 自定义函数
def my_sub(x, y):
    return x + y
# 返回多个值

def re_mor_value(x,y):
    return x,y

print(my_sub("1", "r"))
x, y = re_mor_value(1, 2)
print(x, y)

# 对函数参数进行类型判断
def my_max(x):
    if not isinstance(x,(int, float)):
        raise TypeError('类型有错')
    return 0

import math
a = 5*5-4*2*2
x = math.sqrt(a)
print(a)
def quadratic(a, b, c):
    a = b*b-4*a*c
    x  = math.sqrt(a)
    r1 = (-b + x)/(2 * a)
    r2 = (-b - x)/(2 * a)
    return r1, r2
print(quadratic(2, 5, 1))